import { createRouter, createWebHistory } from 'vue-router'
import HomeView from '../views/home/Home.vue'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      name: 'home',
      component: HomeView,
    },
  ],
})
router.beforeEach((to) => {
  if (to.path === '/neps') {
    window.location.replace('http://neps.weblearning.fun')
    return false // 终止 Vue 路由跳转
  }
  if (to.path === '/nepg') {
    window.location.replace('http://nepg.weblearning.fun')
    return false // 终止 Vue 路由跳转
  }
  if (to.path === '/nepm') {
    window.location.replace('http://nepm.weblearning.fun')
    return false // 终止 Vue 路由跳转
  }
  if (to.path === '/nepv') {
    window.location.replace('http://nepv.weblearning.fun')
    return false // 终止 Vue 路由跳转
  }
})
export default router
